import request from '@/utils/request'

// 查询失效库列表
export function listFailure(query) {
  return request({
    url: '/fmea/pfmea/failure/list',
    method: 'get',
    params: query
  })
}

// 查询失效库详细
export function getFailure(knowledgetype) {
  return request({
    url: '/fmea/pfmea/failure/' + knowledgetype,
    method: 'get'
  })
}

// 新增失效库
export function addFailure(data) {
  return request({
    url: '/fmea/pfmea/failure',
    method: 'post',
    data: data
  })
}

// 修改失效库
export function updateFailure(data) {
  return request({
    url: '/fmea/pfmea/failure',
    method: 'put',
    data: data
  })
}

// 删除失效库
export function delFailure(knowledgetype) {
  return request({
    url: '/fmea/pfmea/failure/' + knowledgetype,
    method: 'delete'
  })
}

// 导出失效库
export function exportFailure(query) {
  return request({
    url: '/fmea/pfmea/failure/export',
    method: 'get',
    params: query
  })
}

// 修改版本状态
export function modifyVStatus(query) {
  return request({
    url: '/fmea/pfmea/failure/updateVersionStatus',
    method: 'get',
    params: query
  })
}
// 校验失效库
export function exactFailureKnow(query) {
  return request({
    url: '/fmea/pfmea/failure/exactQuery',
    method: 'get',
    params: query
  })
}

// 下载模板
export function downLoadTemplate(query) {
  return request({
    url: '/fmea/pfmea/failure/downloadImportFailureTemplate',
    method: 'get',
    params: query
  })
}
